All Questions
37 questions
1vote
1answer
642views
What are the best way to publish application event in a spring boot application?
My goal is to collect/publish different types of information from the application. We use Kafka for the event bus. Consider the following sample code. class UserService { public User ...
3votes
0answers
249views
Logging by 3rd party libraries
We've got 2 very large platforms for our services & jobs. Both platforms consists of 20+ servers hosting 1000+ services/jobs. Each job/service is essentially a java web application. Both ...
2votes
3answers
2kviews
What is the proper logging level for tests?
I raised an issue at my employer concerning our gigantic heaps of testing logs. I raised the issue because I was spending well over a minute to find the relevant logs and stack-trace. I stated we ...
0votes
1answer
339views
When to use logger.info in sl4j
For my application logs for a REST server, I'd like to log some details about each http request. I'm using sl4j. Should I use logger.debug or logger.info More generally what sort of things should be ...
0votes
2answers
4kviews
what is the impact of logging (or excessive logging) of messages to log file on application performance?
Do logging impact application performance? First thing to know is , whether logs are written serially as processing takes place or are logged into file i a separate process? In java world how should ...
1vote
1answer
446views
logger initialization in JEE based web application
While working on a web (JEE based) application I saw some different ways people have instantiated loggers in different classes. First way is classic way like, private static final Logger logger = ...
1vote
2answers
3kviews
Auditing web application user changes
I have a web application written in Java, Oracle, and AngularJS. I want to save log in database when user changes, creates or updates something. There are two way of implementing this: 1. Auditing ...
3votes
4answers
986views
What is the point of logging? [closed]
I got asked a question today that was so basic I was unsure how to answer it. I had added some logging statements to our integration testing package, to find out what part of it was taking so long (...
3votes
0answers
2kviews
How should I store user activities in ElasticSearch and figure out popular searches?
I've got java logging user activities to Fluentd, Fluentd is then writing these activities into an elasticsearch index. Every user activity is recorded, some include: User1 follows user2 User1 likes ...
1vote
1answer
1kviews
Common helper class for logging
I have few classes which used System.out.println (which should be avoided) and now I am trying to move those into a logger. We already have been using logger in some other modules. But the module I'm ...
3votes
3answers
8kviews
Logging an audit trail (Java application)
I'm creating a Java (Spring Boot) application for creating Entities. I've got my @Controller for getting the data from a web front end, I've got my @Service for processing the data, and I've got my @...
5votes
1answer
7kviews
Logging RestTemplate's responses
I want to log responses using Spring's RestTemplate. At first I thought I should do it using a ClientHttpRequestInterceptor, but since every set of requests should be logged to a different file, I ...
2votes
2answers
256views
Can I alter the code while adding logging?
When I add logging (e.g. log4j2 in Java) to existing code, is it ok (good practice), to alter the code? Consider the following example: //if process returned 0 return true return (returnCode == ...
7votes
1answer
9kviews
Log4j logger per class vs logger per application
I am stuck at understanding a concept related to Logger creation, especially in the context of Java EE. In my experience, I nearly always used one logger per application, with few cases when I needed ...
1vote
1answer
457views
Are there any arguments for using a local logger variable
PMD Rule LoggerIsNotStaticFinal: In most cases, the Logger reference can be declared as static and final. I seem to remember some arguments for using local variables for logging, but cannot recall ...